//
//  FPBaseTabBarController.m
//  FilmParadise
//
//  Created by YangYujie on 15/7/13.
//  Copyright (c) 2015年 DLYgroup. All rights reserved.
//
#import "FPBaseNavigationController.h"
#import "FPBaseTabBarController.h"
#import "FPMainViewController.h"
#import "FPDiscoverViewController.h"
#import "FPRootViewController.h"
#import "FPMyViewController.h"
@interface FPBaseTabBarController ()

@end

@implementation FPBaseTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];
    FPMainViewController *mainTVC = [[FPMainViewController alloc]init];
    [self AddViewController:mainTVC name:@"首页" image:@"home-vector"];
    FPRootViewController *movieTVC = [[FPRootViewController alloc]init];
    [self AddViewController:movieTVC name:@"影视" image:@"movie-vector"];
    FPDiscoverViewController *dicVC = [[FPDiscoverViewController alloc]init];
    [self AddViewController:dicVC name:@"发现" image:@"globe-vector"];
    FPMyViewController *myVC = [[FPMyViewController alloc]init];
    [self AddViewController:myVC name:@"我的" image:@"box-vector"];


}
- (void)AddViewController:(UIViewController *)viewC name:(NSString *)name image:(NSString *)image
{
    viewC.tabBarItem.title = name;
    
    viewC.tabBarItem.image = [UIImage imageNamed:image];
    
    
    FPBaseNavigationController *navC = [[FPBaseNavigationController alloc]initWithRootViewController:viewC];
    [self addChildViewController:navC];
    
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
